package com.springcloud.eurekaclient.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SayHiController {

    @Autowired
    Environment environment;

    public String getPort(){
        return environment.getProperty("local.server.port");
    }
    @GetMapping("/hi")
    public  String hi(){
      return  "say ,hi!  " + getPort();
    }
}
